package com.example.crossborderecommerce.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 库单
 *
 * @author Yolanda
 * @since 2024-05-09
 */
@Data
@Accessors(chain = true)
@TableName("store_receipt")
public class StoreReceipt implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("type")
    private String type;

    @TableField("store_id")
    private Integer storeId;

    @TableField(exist = false)
    private String storeName;

    @TableField("store_commodity_id")
    private Integer storeCommodityId;

    @TableField(exist = false)
    private Integer productId;

    @TableField(exist = false)
    private String storeCommodityName;

    @TableField("object_id")
    private Integer objectId;

    @TableField(exist = false)
    private String objectName;

    @TableField("admin_id")
    private Integer adminId;

    @TableField(exist = false)
    private String adminName;

    @TableField("price")
    private Double price;

    @TableField("quantity")
    private Integer quantity;

    @TableField(exist = false)
    private Integer quantityBefore;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //指定格式
    private LocalDateTime createTime;
}
